import Vue from "vue";
import VueRouter from "vue-router";

import Login from "../views/login_register/Login";
import Register from "../views/login_register/Register";
import A_key_login from "../views/login_register/A_key_login";
import "../style/font_37n6baxkyw9/iconfont";

A_key_login;
Vue.use(VueRouter);

const routes = [
  { path: "/akeylogin", component: A_key_login },
  { path: "/login", component: Login },
  { path: "/register", component: Register },
  {
    path: "/",
    //component: Home,
    component: () => import("../views/Home"),
    children: [
      {
        path: "/",
        redirect: "/index",
      },
      {
        path: "/index",
        component: () => import("../components/index/index"),
      },
      {
        path: "/chat",
        component: () => import("../components/Chat/Chat.vue"),
      },
      {
        path: "/customization",
        component: () =>
          import("../components/Customization/Customization.vue"),
      },
      {
        path: "/mypage/index",
        name: "MineIndex",
        component: () => import("../views/mypage/Index.vue"),
      },
    ],
  },
  {
    path: "/mypage/change",
    name: "MineChange",
    component: () => import("../views/mypage/Change.vue"),
  },
  {
    path: "/mypage/image",
    name: "MineImage",
    component: () => import("../views/mypage/Image.vue"),
  },
  {
    path: "/abc",
    // name: "",
    // // route level code-splitting
    // // this generates a separate chunk (Cartail.[hash].js) for this route
    // // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "Cartail" */
        "../components/index/Banner.vue"
      ),
  },
  {
    path: "/beauty", //首页美妆榜一级
    component: () => import("../components/index/Ranking/Beauty.vue"),
  },
  {
    path: "/product", //首页查产品
    component: () => import("../components/index/Ranking/Product.vue"),
    children: [
      {
        path: "/product",
        redirect: "/all",
      },
      {
        //查产品二级路由 全部
        path: "/all",
        component: () =>
          import("../components/index/Ranking/product/prooption/all.vue"),
      },
      {
        //查产品二级路由 文章
        path: "/atricle",
        component: () =>
          import("../components/index/Ranking/product/prooption/atricle.vue"),
      },
      {
        //查产品二级路由 产品
        path: "/pro",
        component: () =>
          import("../components/index/Ranking/product/prooption/pro.vue"),
      },
      {
        //查产品二级路由 话题
        path: "/topic",
        component: () =>
          import("../components/index/Ranking/product/prooption/topic.vue"),
      },
      {
        //查产品二级路由 成分
        path: "/element",
        component: () =>
          import("../components/index/Ranking/product/prooption/element.vue"),
      },
    ],
  },
  {
    path: "/skin", //首页护肤榜
    component: () => import("../components/index/Ranking/Skin.vue"),
  },
  {
    path: "/brandstore", //首页品牌库
    component: () => import("../components/index/Ranking/Brandstore.vue"),
  },
  {
    path: "/fuli", //首页品牌库
    component: () => import("../components/index/Ranking/Fuli.vue"),
  },
  {
    path: "/detail", //产品详情页
    component: () => import("../views/Detail"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
